home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / SCSI.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  50.6 KB  |  1,053 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        SCSI.p
  3.  
  4.      Contains:    SCSI Family Interfaces.
  5.  
  6.      Version:    Technology:    SCSI 4.3
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1986-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT SCSI;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SCSI__}
  28. {$SETC __SCSI__ := 1}
  29.  
  30. {$I+}
  31. {$SETC SCSIIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46. { SCSI Manager errors. These are generated by Inside Mac IV calls only. }
  47.  
  48. CONST
  49.     scCommErr                    = 2;                            {  communications error, operation timeout  }
  50.     scArbNBErr                    = 3;                            {  arbitration timeout waiting for not BSY  }
  51.     scBadParmsErr                = 4;                            {  bad parameter or TIB opcode  }
  52.     scPhaseErr                    = 5;                            {  SCSI bus not in correct phase for attempted operation  }
  53.     scCompareErr                = 6;                            {  data compare error  }
  54.     scMgrBusyErr                = 7;                            {  SCSI Manager busy   }
  55.     scSequenceErr                = 8;                            {  attempted operation is out of sequence  }
  56.     scBusTOErr                    = 9;                            {  CPU bus timeout  }
  57.     scComplPhaseErr                = 10;                            {  SCSI bus wasn't in Status phase  }
  58.  
  59. { TIB opcodes }
  60.     scInc                        = 1;
  61.     scNoInc                        = 2;
  62.     scAdd                        = 3;
  63.     scMove                        = 4;
  64.     scLoop                        = 5;
  65.     scNop                        = 6;
  66.     scStop                        = 7;
  67.     scComp                        = 8;
  68.  
  69. { Signatures }
  70.     sbSIGWord                    = $4552;                        {  signature word for Block 0 ('ER')  }
  71.     sbMac                        = 1;                            {  system type for Mac  }
  72.     pMapSIG                        = $504D;                        {  partition map signature ('PM')  }
  73.     pdSigWord                    = $5453;
  74.  
  75.     oldPMSigWord                = $5453;
  76.     newPMSigWord                = $504D;
  77.  
  78. { Driver Descriptor Map }
  79.  
  80. TYPE
  81.     Block0Ptr = ^Block0;
  82.     Block0 = PACKED RECORD
  83.         sbSig:                    UInt16;                                    {  unique value for SCSI block 0  }
  84.         sbBlkSize:                UInt16;                                    {  block size of device  }
  85.         sbBlkCount:                UInt32;                                    {  number of blocks on device  }
  86.         sbDevType:                UInt16;                                    {  device type  }
  87.         sbDevId:                UInt16;                                    {  device id  }
  88.         sbData:                    UInt32;                                    {  not used  }
  89.         sbDrvrCount:            UInt16;                                    {  driver descriptor count  }
  90.         ddBlock:                UInt32;                                    {  1st driver's starting block  }
  91.         ddSize:                    UInt16;                                    {  size of 1st driver (512-byte blks)  }
  92.         ddType:                    UInt16;                                    {  system type (1 for Mac+)  }
  93.         ddPad:                    ARRAY [0..242] OF UInt16;                {  ARRAY[0..242] OF INTEGER; not used  }
  94.     END;
  95.  
  96. { Driver descriptor }
  97.     DDMapPtr = ^DDMap;
  98.     DDMap = RECORD
  99.         ddBlock:                UInt32;                                    {  1st driver's starting block  }
  100.         ddSize:                    UInt16;                                    {  size of 1st driver (512-byte blks)  }
  101.         ddType:                    UInt16;                                    {  system type (1 for Mac+)  }
  102.     END;
  103.  
  104. { Partition Map Entry }
  105.     PartitionPtr = ^Partition;
  106.     Partition = PACKED RECORD
  107.         pmSig:                    UInt16;                                    {  unique value for map entry blk  }
  108.         pmSigPad:                UInt16;                                    {  currently unused  }
  109.         pmMapBlkCnt:            UInt32;                                    {  # of blks in partition map  }
  110.         pmPyPartStart:            UInt32;                                    {  physical start blk of partition  }
  111.         pmPartBlkCnt:            UInt32;                                    {  # of blks in this partition  }
  112.         pmPartName:                PACKED ARRAY [0..31] OF UInt8;            {  ASCII partition name  }
  113.         pmParType:                PACKED ARRAY [0..31] OF UInt8;            {  ASCII partition type  }
  114.         pmLgDataStart:            UInt32;                                    {  log. # of partition's 1st data blk  }
  115.         pmDataCnt:                UInt32;                                    {  # of blks in partition's data area  }
  116.         pmPartStatus:            UInt32;                                    {  bit field for partition status  }
  117.         pmLgBootStart:            UInt32;                                    {  log. blk of partition's boot code  }
  118.         pmBootSize:                UInt32;                                    {  number of bytes in boot code  }
  119.         pmBootAddr:                UInt32;                                    {  memory load address of boot code  }
  120.         pmBootAddr2:            UInt32;                                    {  currently unused  }
  121.         pmBootEntry:            UInt32;                                    {  entry point of boot code  }
  122.         pmBootEntry2:            UInt32;                                    {  currently unused  }
  123.         pmBootCksum:            UInt32;                                    {  checksum of boot code  }
  124.         pmProcessor:            PACKED ARRAY [0..15] OF UInt8;            {  ASCII for the processor type  }
  125.         pmPad:                    ARRAY [0..187] OF UInt16;                {  ARRAY[0..187] OF INTEGER; not used  }
  126.     END;
  127.  
  128. { TIB instruction }
  129.     SCSIInstrPtr = ^SCSIInstr;
  130.     SCSIInstr = RECORD
  131.         scOpcode:                UInt16;
  132.         scParam1:                LONGINT;
  133.         scParam2:                LONGINT;
  134.     END;
  135.  
  136. { SCSI Phases (used by SIMs to support the Original SCSI Manager }
  137.  
  138. CONST
  139.     kDataOutPhase                = 0;                            {  Encoded MSG, C/D, I/O bits  }
  140.     kDataInPhase                = 1;
  141.     kCommandPhase                = 2;
  142.     kStatusPhase                = 3;
  143.     kPhaseIllegal0                = 4;
  144.     kPhaseIllegal1                = 5;
  145.     kMessageOutPhase            = 6;
  146.     kMessageInPhase                = 7;
  147.     kBusFreePhase                = 8;                            {  Additional Phases  }
  148.     kArbitratePhase                = 9;
  149.     kSelectPhase                = 10;
  150.     kMessageInPhaseNACK            = 11;                            {  Message In Phase with ACK hanging on the bus  }
  151.  
  152.  
  153. FUNCTION SCSIReset: OSErr;
  154.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  155.     INLINE $4267, $A815;
  156.     {$ENDC}
  157. FUNCTION SCSIGet: OSErr;
  158.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  159.     INLINE $3F3C, $0001, $A815;
  160.     {$ENDC}
  161. FUNCTION SCSISelect(targetID: INTEGER): OSErr;
  162.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  163.     INLINE $3F3C, $0002, $A815;
  164.     {$ENDC}
  165. FUNCTION SCSICmd(buffer: Ptr; count: INTEGER): OSErr;
  166.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  167.     INLINE $3F3C, $0003, $A815;
  168.     {$ENDC}
  169. FUNCTION SCSIRead(tibPtr: Ptr): OSErr;
  170.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  171.     INLINE $3F3C, $0005, $A815;
  172.     {$ENDC}
  173. FUNCTION SCSIRBlind(tibPtr: Ptr): OSErr;
  174.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  175.     INLINE $3F3C, $0008, $A815;
  176.     {$ENDC}
  177. FUNCTION SCSIWrite(tibPtr: Ptr): OSErr;
  178.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  179.     INLINE $3F3C, $0006, $A815;
  180.     {$ENDC}
  181. FUNCTION SCSIWBlind(tibPtr: Ptr): OSErr;
  182.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  183.     INLINE $3F3C, $0009, $A815;
  184.     {$ENDC}
  185. FUNCTION SCSIComplete(VAR stat: INTEGER; VAR message: INTEGER; wait: UInt32): OSErr;
  186.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  187.     INLINE $3F3C, $0004, $A815;
  188.     {$ENDC}
  189. FUNCTION SCSIStat: INTEGER;
  190.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  191.     INLINE $3F3C, $000A, $A815;
  192.     {$ENDC}
  193. FUNCTION SCSISelAtn(targetID: INTEGER): OSErr;
  194.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  195.     INLINE $3F3C, $000B, $A815;
  196.     {$ENDC}
  197. FUNCTION SCSIMsgIn(VAR message: INTEGER): OSErr;
  198.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  199.     INLINE $3F3C, $000C, $A815;
  200.     {$ENDC}
  201. FUNCTION SCSIMsgOut(message: INTEGER): OSErr;
  202.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  203.     INLINE $3F3C, $000D, $A815;
  204.     {$ENDC}
  205.  
  206.  
  207. CONST
  208.     scsiVERSION                    = 43;
  209.  
  210.  
  211. {
  212.  * SCSI Callback Procedure Prototypes. Several of these are only callable
  213.  * from SCSI Manager 4.3 SIM and XPT contexts. 
  214.  }
  215.  
  216. TYPE
  217. {$IFC TYPED_FUNCTION_POINTERS}
  218.     AENCallbackProcPtr = PROCEDURE; C;
  219. {$ELSEC}
  220.     AENCallbackProcPtr = ProcPtr;
  221. {$ENDC}
  222.  
  223. {$IFC TYPED_FUNCTION_POINTERS}
  224.     SIMInitProcPtr = FUNCTION(SIMinfoPtr: Ptr): OSErr; C;
  225. {$ELSEC}
  226.     SIMInitProcPtr = ProcPtr;
  227. {$ENDC}
  228.  
  229. {$IFC TYPED_FUNCTION_POINTERS}
  230.     SIMActionProcPtr = PROCEDURE(scsiPB: UNIV Ptr; SIMGlobals: Ptr); C;
  231. {$ELSEC}
  232.     SIMActionProcPtr = ProcPtr;
  233. {$ENDC}
  234.  
  235. {$IFC TYPED_FUNCTION_POINTERS}
  236.     SCSIProcPtr = PROCEDURE; C;
  237. {$ELSEC}
  238.     SCSIProcPtr = ProcPtr;
  239. {$ENDC}
  240.  
  241. {$IFC TYPED_FUNCTION_POINTERS}
  242.     SCSIMakeCallbackProcPtr = PROCEDURE(scsiPB: UNIV Ptr); C;
  243. {$ELSEC}
  244.     SCSIMakeCallbackProcPtr = ProcPtr;
  245. {$ENDC}
  246.  
  247. { SCSIInterruptPollProcPtr is obsolete (use SCSIInterruptProcPtr) but still here for compatibility }
  248. {$IFC TYPED_FUNCTION_POINTERS}
  249.     SCSIInterruptPollProcPtr = FUNCTION(SIMGlobals: Ptr): LONGINT; C;
  250. {$ELSEC}
  251.     SCSIInterruptPollProcPtr = ProcPtr;
  252. {$ENDC}
  253.  
  254. {$IFC TYPED_FUNCTION_POINTERS}
  255.     SCSIInterruptProcPtr = FUNCTION(SIMGlobals: Ptr): LONGINT; C;
  256. {$ELSEC}
  257.     SCSIInterruptProcPtr = ProcPtr;
  258. {$ENDC}
  259.  
  260.     AENCallbackUPP = UniversalProcPtr;
  261.     SIMInitUPP = UniversalProcPtr;
  262.     SIMActionUPP = UniversalProcPtr;
  263.     SCSIUPP = UniversalProcPtr;
  264.     SCSIMakeCallbackUPP = UniversalProcPtr;
  265.     SCSIInterruptPollUPP = UniversalProcPtr;
  266.     SCSIInterruptUPP = UniversalProcPtr;
  267. {$IFC TYPED_FUNCTION_POINTERS}
  268.     SCSICallbackProcPtr = PROCEDURE(scsiPB: UNIV Ptr);
  269. {$ELSEC}
  270.     SCSICallbackProcPtr = ProcPtr;
  271. {$ENDC}
  272.  
  273.     SCSICallbackUPP = UniversalProcPtr;
  274.  
  275. CONST
  276.     uppAENCallbackProcInfo = $00000001;
  277.     uppSIMInitProcInfo = $000000E1;
  278.     uppSIMActionProcInfo = $000003C1;
  279.     uppSCSIProcInfo = $00000001;
  280.     uppSCSIMakeCallbackProcInfo = $000000C1;
  281.     uppSCSIInterruptPollProcInfo = $000000F1;
  282.     uppSCSIInterruptProcInfo = $000000F1;
  283.     uppSCSICallbackProcInfo = $000000C0;
  284.  
  285. FUNCTION NewAENCallbackProc(userRoutine: AENCallbackProcPtr): AENCallbackUPP;
  286.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  287.     INLINE $2E9F;
  288.     {$ENDC}
  289.  
  290. FUNCTION NewSIMInitProc(userRoutine: SIMInitProcPtr): SIMInitUPP;
  291.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  292.     INLINE $2E9F;
  293.     {$ENDC}
  294.  
  295. FUNCTION NewSIMActionProc(userRoutine: SIMActionProcPtr): SIMActionUPP;
  296.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  297.     INLINE $2E9F;
  298.     {$ENDC}
  299.  
  300. FUNCTION NewSCSIProc(userRoutine: SCSIProcPtr): SCSIUPP;
  301.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  302.     INLINE $2E9F;
  303.     {$ENDC}
  304.  
  305. FUNCTION NewSCSIMakeCallbackProc(userRoutine: SCSIMakeCallbackProcPtr): SCSIMakeCallbackUPP;
  306.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  307.     INLINE $2E9F;
  308.     {$ENDC}
  309.  
  310. FUNCTION NewSCSIInterruptPollProc(userRoutine: SCSIInterruptPollProcPtr): SCSIInterruptPollUPP;
  311.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  312.     INLINE $2E9F;
  313.     {$ENDC}
  314.  
  315. FUNCTION NewSCSIInterruptProc(userRoutine: SCSIInterruptProcPtr): SCSIInterruptUPP;
  316.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  317.     INLINE $2E9F;
  318.     {$ENDC}
  319.  
  320. FUNCTION NewSCSICallbackProc(userRoutine: SCSICallbackProcPtr): SCSICallbackUPP;
  321.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  322.     INLINE $2E9F;
  323.     {$ENDC}
  324.  
  325. PROCEDURE CallAENCallbackProc(userRoutine: AENCallbackUPP);
  326.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  327.     {To be implemented:  Glue to move parameters into registers.}
  328.     {$ENDC}
  329.  
  330. FUNCTION CallSIMInitProc(SIMinfoPtr: Ptr; userRoutine: SIMInitUPP): OSErr;
  331.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  332.     {To be implemented:  Glue to move parameters into registers.}
  333.     {$ENDC}
  334.  
  335. PROCEDURE CallSIMActionProc(scsiPB: UNIV Ptr; SIMGlobals: Ptr; userRoutine: SIMActionUPP);
  336.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  337.     {To be implemented:  Glue to move parameters into registers.}
  338.     {$ENDC}
  339.  
  340. PROCEDURE CallSCSIProc(userRoutine: SCSIUPP);
  341.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  342.     {To be implemented:  Glue to move parameters into registers.}
  343.     {$ENDC}
  344.  
  345. PROCEDURE CallSCSIMakeCallbackProc(scsiPB: UNIV Ptr; userRoutine: SCSIMakeCallbackUPP);
  346.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  347.     {To be implemented:  Glue to move parameters into registers.}
  348.     {$ENDC}
  349.  
  350. FUNCTION CallSCSIInterruptPollProc(SIMGlobals: Ptr; userRoutine: SCSIInterruptPollUPP): LONGINT;
  351.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  352.     {To be implemented:  Glue to move parameters into registers.}
  353.     {$ENDC}
  354.  
  355. FUNCTION CallSCSIInterruptProc(SIMGlobals: Ptr; userRoutine: SCSIInterruptUPP): LONGINT;
  356.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  357.     {To be implemented:  Glue to move parameters into registers.}
  358.     {$ENDC}
  359.  
  360. PROCEDURE CallSCSICallbackProc(scsiPB: UNIV Ptr; userRoutine: SCSICallbackUPP);
  361.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  362.     INLINE $205F, $4E90;
  363.     {$ENDC}
  364. { SCSI Manager 4.3 function codes }
  365.  
  366. CONST
  367.     SCSINop                        = $00;                            {  Execute nothing                                          }
  368.     SCSIExecIO                    = $01;                            {  Execute the specified IO                              }
  369.     SCSIBusInquiry                = $03;                            {  Get parameters for entire path of HBAs                  }
  370.     SCSIReleaseQ                = $04;                            {  Release the frozen SIM queue for particular LUN          }
  371.     SCSIAbortCommand            = $10;                            {  Abort the selected Control Block                       }
  372.     SCSIResetBus                = $11;                            {  Reset the SCSI bus                                       }
  373.     SCSIResetDevice                = $12;                            {  Reset the SCSI device                                   }
  374.     SCSITerminateIO                = $13;                            {  Terminate any pending IO                               }
  375.     SCSIGetVirtualIDInfo        = $80;                            {  Find out which bus old ID is on                          }
  376.     SCSILoadDriver                = $82;                            {  Load a driver for a device ident                      }
  377.     SCSIOldCall                    = $84;                            {  XPT->SIM private call for old-API                      }
  378.     SCSICreateRefNumXref        = $85;                            {  Register a DeviceIdent to drvr RefNum xref              }
  379.     SCSILookupRefNumXref        = $86;                            {  Get DeviceIdent to drvr RefNum xref                      }
  380.     SCSIRemoveRefNumXref        = $87;                            {  Remove a DeviceIdent to drvr RefNum xref              }
  381.     SCSIRegisterWithNewXPT        = $88;                            {  XPT has changed - SIM needs to re-register itself      }
  382.     vendorUnique                = $C0;                            {  0xC0 thru 0xFF  }
  383.  
  384.  
  385. { Allocation length defines for some of the fields }
  386.     handshakeDataLength            = 8;                            {  Handshake data length  }
  387.     maxCDBLength                = 16;                            {  Space for the CDB bytes/pointer  }
  388.     vendorIDLength                = 16;                            {  ASCII string len for Vendor ID   }
  389.  
  390. { Define DeviceIdent structure }
  391.  
  392. TYPE
  393.     DeviceIdentPtr = ^DeviceIdent;
  394.     DeviceIdent = PACKED RECORD
  395.         diReserved:                UInt8;                                    {  reserved                  }
  396.         bus:                    UInt8;                                    {  SCSI - Bus Number         }
  397.         targetID:                UInt8;                                    {  SCSI - Target SCSI ID     }
  398.         LUN:                    UInt8;                                    {  SCSI - LUN                   }
  399.     END;
  400.  
  401. { Command Descriptor Block structure }
  402.     CDBPtr = ^CDB;
  403.     CDB = RECORD
  404.         CASE INTEGER OF
  405.         0: (
  406.             cdbPtr:                BytePtr;                                {  pointer to the CDB, or  }
  407.             );
  408.         1: (
  409.             cdbBytes:            PACKED ARRAY [0..15] OF UInt8;            {  the actual CDB to send  }
  410.             );
  411.     END;
  412.  
  413. { Scatter/gather list element (Deprecated for MacOS8) }
  414.     SGRecordPtr = ^SGRecord;
  415.     SGRecord = RECORD
  416.         SGAddr:                    Ptr;
  417.         SGCount:                UInt32;
  418.     END;
  419.  
  420.     SCSIHdrPtr = ^SCSIHdr;
  421.     SCSIHdr = RECORD
  422.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  423.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  424.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  425.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  426.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  427.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  428.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  429.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  430.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  431.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  432.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  433.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  434.     END;
  435.  
  436.     SCSI_PBPtr = ^SCSI_PB;
  437.     SCSI_PB = RECORD
  438.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  439.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  440.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  441.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  442.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  443.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  444.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  445.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  446.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  447.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  448.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  449.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  450.     END;
  451.  
  452.     SCSI_IOPtr = ^SCSI_IO;
  453.     SCSI_IO = RECORD
  454.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  455.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  456.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  457.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  458.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  459.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  460.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  461.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  462.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  463.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  464.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  465.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  466.         scsiResultFlags:        UInt16;                                    {  <- Flags which modify the scsiResult field         }
  467.         scsiReserved3pt5:        UInt16;                                    {  -> Reserved                                         }
  468.         scsiDataPtr:            BytePtr;                                {  -> Pointer to the data buffer or the S/G list       }
  469.         scsiDataLength:            UInt32;                                    {  -> Data transfer length                             }
  470.         scsiSensePtr:            BytePtr;                                {  -> Ptr to autosense data buffer                   }
  471.         scsiSenseLength:        SInt8;                                    {  -> size of the autosense buffer                      }
  472.         scsiCDBLength:            SInt8;                                    {  -> Number of bytes for the CDB                       }
  473.         scsiSGListCount:        UInt16;                                    {  -> num of scatter gather list entries               }
  474.         scsiReserved4:            UInt32;                                    {  <-     reserved for output                             }
  475.         scsiSCSIstatus:            SInt8;                                    {  <- Returned scsi device status                       }
  476.         scsiSenseResidual:        SInt8;                                    {  <- Autosense residual length                       }
  477.         scsiReserved5:            UInt16;                                    {  <-     reserved for output                              }
  478.         scsiDataResidual:        LONGINT;                                {  <- Returned Transfer residual length               }
  479.         scsiCDB:                CDB;                                    {  -> Actual CDB or pointer to CDB                   }
  480.         scsiTimeout:            LONGINT;                                {  -> Timeout value (Time Mgr format) (CAM timeout)  }
  481.         scsiReserved5pt5:        BytePtr;                                {  -> Reserved                                         }
  482.         scsiReserved5pt6:        UInt16;                                    {  -> Reserved                                         }
  483.         scsiIOFlags:            UInt16;                                    {  -> additional I/O flags                                }
  484.         scsiTagAction:            SInt8;                                    {  -> What to do for tag queuing                        }
  485.         scsiReserved6:            SInt8;                                    {  ->     reserved for input                              }
  486.         scsiReserved7:            UInt16;                                    {  ->     reserved for input                              }
  487.         scsiSelectTimeout:        UInt16;                                    {  -> Select timeout value                              }
  488.         scsiDataType:            SInt8;                                    {  -> Data description type (i.e. buffer, TIB, S/G)     }
  489.         scsiTransferType:        SInt8;                                    {  -> Transfer type (i.e. Blind vs Polled)              }
  490.         scsiReserved8:            UInt32;                                    {  ->     reserved for input                              }
  491.         scsiReserved9:            UInt32;                                    {  ->     reserved for input                              }
  492.         scsiHandshake:            ARRAY [0..7] OF UInt16;                    {  -> handshaking points (null term'd)     }
  493.         scsiReserved10:            UInt32;                                    {  ->     reserved for input                              }
  494.         scsiReserved11:            UInt32;                                    {  ->   reserved for input                             }
  495.         scsiCommandLink:        SCSI_IOPtr;                                {  -> Ptr to the next PB in linked cmd chain          }
  496.         scsiSIMpublics:            PACKED ARRAY [0..7] OF UInt8;            {  ->     reserved for input to 3rd-party SIMs         }
  497.         scsiAppleReserved6:        PACKED ARRAY [0..7] OF UInt8;            {  ->    reserved for input                               }
  498.                                                                         {  XPT layer privates (for old-API emulation)  }
  499.         scsiCurrentPhase:        UInt16;                                    {  <- phase upon completing old call                   }
  500.         scsiSelector:            INTEGER;                                {  -> selector specified in old calls                   }
  501.         scsiOldCallResult:        OSErr;                                    {  <- result of old call                               }
  502.         scsiSCSImessage:        SInt8;                                    {  <- Returned scsi device message (for SCSIComplete) }
  503.         XPTprivateFlags:        SInt8;                                    {  <> various flags                                    }
  504.         XPTextras:                PACKED ARRAY [0..11] OF UInt8;            {                                                      }
  505.     END;
  506.  
  507.     SCSIExecIOPB                        = SCSI_IO;
  508.     SCSIExecIOPBPtr                     = ^SCSIExecIOPB;
  509. { Bus inquiry PB }
  510.     SCSIBusInquiryPBPtr = ^SCSIBusInquiryPB;
  511.     SCSIBusInquiryPB = RECORD
  512.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  513.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  514.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  515.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  516.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  517.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  518.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  519.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  520.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  521.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  522.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  523.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  524.         scsiEngineCount:        UInt16;                                    {  <- Number of engines on HBA                          }
  525.         scsiMaxTransferType:    UInt16;                                    {  <- Number of transfer types for this HBA             }
  526.         scsiDataTypes:            UInt32;                                    {  <- which data types are supported by this SIM      }
  527.         scsiIOpbSize:            UInt16;                                    {  <- Size of SCSI_IO PB for this SIM/HBA              }
  528.         scsiMaxIOpbSize:        UInt16;                                    {  <- Size of max SCSI_IO PB for all SIM/HBAs          }
  529.         scsiFeatureFlags:        UInt32;                                    {  <- Supported features flags field                  }
  530.         scsiVersionNumber:        SInt8;                                    {  <- Version number for the SIM/HBA                  }
  531.         scsiHBAInquiry:            SInt8;                                    {  <- Mimic of INQ byte 7 for the HBA                  }
  532.         scsiTargetModeFlags:    SInt8;                                    {  <- Flags for target mode support                  }
  533.         scsiScanFlags:            SInt8;                                    {  <- Scan related feature flags                      }
  534.         scsiSIMPrivatesPtr:        UInt32;                                    {  <- Ptr to SIM private data area                      }
  535.         scsiSIMPrivatesSize:    UInt32;                                    {  <- Size of SIM private data area                  }
  536.         scsiAsyncFlags:            UInt32;                                    {  <- Event cap. for Async Callback                  }
  537.         scsiHiBusID:            SInt8;                                    {  <- Highest path ID in the subsystem               }
  538.         scsiInitiatorID:        SInt8;                                    {  <- ID of the HBA on the SCSI bus                  }
  539.         scsiBIReserved0:        UInt16;                                    {                                                      }
  540.         scsiBIReserved1:        UInt32;                                    {  <-                                                   }
  541.         scsiFlagsSupported:        UInt32;                                    {  <- which scsiFlags are supported                  }
  542.         scsiIOFlagsSupported:    UInt16;                                    {  <- which scsiIOFlags are supported                  }
  543.         scsiWeirdStuff:            UInt16;                                    {  <-                                                  }
  544.         scsiMaxTarget:            UInt16;                                    {  <- maximum Target number supported                  }
  545.         scsiMaxLUN:                UInt16;                                    {  <- maximum Logical Unit number supported          }
  546.         scsiSIMVendor:            PACKED ARRAY [0..15] OF CHAR;            {  <- Vendor ID of SIM (or XPT if bus<FF)          }
  547.         scsiHBAVendor:            PACKED ARRAY [0..15] OF CHAR;            {  <- Vendor ID of the HBA                          }
  548.         scsiControllerFamily:    PACKED ARRAY [0..15] OF CHAR;            {  <- Family of SCSI Controller                  }
  549.         scsiControllerType:        PACKED ARRAY [0..15] OF CHAR;            {  <- Specific Model of SCSI Controller used      }
  550.         scsiXPTversion:            PACKED ARRAY [0..3] OF CHAR;            {  <- version number of XPT                          }
  551.         scsiSIMversion:            PACKED ARRAY [0..3] OF CHAR;            {  <- version number of SIM                          }
  552.         scsiHBAversion:            PACKED ARRAY [0..3] OF CHAR;            {  <- version number of HBA                          }
  553.         scsiHBAslotType:        SInt8;                                    {  <- type of "slot" that this HBA is in             }
  554.         scsiHBAslotNumber:        SInt8;                                    {  <- slot number of this HBA                          }
  555.         scsiSIMsRsrcID:            UInt16;                                    {  <- resource ID of this SIM                          }
  556.         scsiBIReserved3:        UInt16;                                    {  <-                                                  }
  557.         scsiAdditionalLength:    UInt16;                                    {  <- additional BusInquiry PB len                     }
  558.     END;
  559.  
  560. { Abort SIM Request PB }
  561.     SCSIAbortCommandPBPtr = ^SCSIAbortCommandPB;
  562.     SCSIAbortCommandPB = RECORD
  563.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  564.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  565.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  566.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  567.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  568.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  569.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  570.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  571.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  572.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  573.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  574.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  575.         scsiIOptr:                SCSI_IOPtr;                                {  Pointer to the PB to abort             }
  576.     END;
  577.  
  578. { Terminate I/O Process Request PB }
  579.     SCSITerminateIOPBPtr = ^SCSITerminateIOPB;
  580.     SCSITerminateIOPB = RECORD
  581.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  582.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  583.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  584.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  585.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  586.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  587.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  588.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  589.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  590.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  591.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  592.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  593.         scsiIOptr:                SCSI_IOPtr;                                {  Pointer to the PB to terminate          }
  594.     END;
  595.  
  596. { Reset SCSI Bus PB }
  597.     SCSIResetBusPBPtr = ^SCSIResetBusPB;
  598.     SCSIResetBusPB = RECORD
  599.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  600.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  601.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  602.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  603.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  604.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  605.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  606.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  607.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  608.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  609.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  610.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  611.     END;
  612.  
  613. { Reset SCSI Device PB }
  614.     SCSIResetDevicePBPtr = ^SCSIResetDevicePB;
  615.     SCSIResetDevicePB = RECORD
  616.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  617.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  618.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  619.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  620.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  621.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  622.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  623.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  624.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  625.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  626.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  627.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  628.     END;
  629.  
  630. { Release SIM Queue PB }
  631.     SCSIReleaseQPBPtr = ^SCSIReleaseQPB;
  632.     SCSIReleaseQPB = RECORD
  633.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  634.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  635.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  636.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  637.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  638.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  639.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  640.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  641.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  642.         scsiDriverStorage:        BytePtr;                                {  <> Ptr for driver private use         }
  643.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  644.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  645.     END;
  646.  
  647. { SCSI Get Virtual ID Info PB }
  648.     SCSIGetVirtualIDInfoPBPtr = ^SCSIGetVirtualIDInfoPB;
  649.     SCSIGetVirtualIDInfoPB = RECORD
  650.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  651.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  652.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  653.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  654.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  655.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  656.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  657.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  658.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  659.         scsiDriverStorage:        Ptr;                                    {  <> Ptr for driver private use         }
  660.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  661.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  662.         scsiOldCallID:            UInt16;                                    {  -> SCSI ID of device in question      }
  663.         scsiExists:                BOOLEAN;                                {  <- true if device exists              }
  664.         filler:                    SInt8;
  665.     END;
  666.  
  667. { Create/Lookup/Remove RefNum for Device PB }
  668.     SCSIDriverPBPtr = ^SCSIDriverPB;
  669.     SCSIDriverPB = RECORD
  670.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  671.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  672.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  673.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  674.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  675.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  676.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  677.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  678.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  679.         scsiDriverStorage:        Ptr;                                    {  <> Ptr for driver private use         }
  680.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  681.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  682.         scsiDriver:                INTEGER;                                {  -> DriverRefNum, For SetDriver, <- For GetNextDriver  }
  683.         scsiDriverFlags:        UInt16;                                    {  <> Details of driver/device              }
  684.         scsiNextDevice:            DeviceIdent;                            {  <- DeviceIdent of the NEXT Item in the list   }
  685.     END;
  686.  
  687. { Load Driver PB }
  688.     SCSILoadDriverPBPtr = ^SCSILoadDriverPB;
  689.     SCSILoadDriverPB = RECORD
  690.         qLink:                    SCSIHdrPtr;                                {  (internal use, must be nil on entry)     }
  691.         scsiReserved1:            INTEGER;                                {  ->     reserved for input                 }
  692.         scsiPBLength:            UInt16;                                    {  -> Length of the entire PB             }
  693.         scsiFunctionCode:        SInt8;                                    {  -> function selector                  }
  694.         scsiReserved2:            SInt8;                                    {  <-     reserved for output                 }
  695.         scsiResult:                OSErr;                                    {  <- Returned result                      }
  696.         scsiDevice:                DeviceIdent;                            {  -> Device Identifier (bus+target+lun) }
  697.         scsiCompletion:            SCSICallbackUPP;                        {  -> Callback on completion function       }
  698.         scsiFlags:                UInt32;                                    {  -> assorted flags                     }
  699.         scsiDriverStorage:        Ptr;                                    {  <> Ptr for driver private use         }
  700.         scsiXPTprivate:            Ptr;                                    {  private field for use in XPT             }
  701.         scsiReserved3:            LONGINT;                                {  reserved                                 }
  702.         scsiLoadedRefNum:        INTEGER;                                {  <- SIM returns refnum of driver          }
  703.         scsiDiskLoadFailed:        BOOLEAN;                                {  -> if true, indicates call after failure to load  }
  704.         filler:                    SInt8;
  705.     END;
  706.  
  707.  
  708. { Defines for the scsiTransferType field }
  709.  
  710. CONST
  711.     scsiTransferBlind            = 0;
  712.     scsiTransferPolled            = 1;
  713.  
  714.     scsiErrorBase                = -7936;
  715.  
  716.     scsiRequestInProgress        = 1;                            {  1     = PB request is in progress              }
  717.                                                                 {  Execution failed  00-2F  }
  718.     scsiRequestAborted            = -7934;                        {  -7934 = PB request aborted by the host          }
  719.     scsiUnableToAbort            = -7933;                        {  -7933 = Unable to Abort PB request              }
  720.     scsiNonZeroStatus            = -7932;                        {  -7932 = PB request completed with an err      }
  721.     scsiUnused05                = -7931;                        {  -7931 =                                       }
  722.     scsiUnused06                = -7930;                        {  -7930 =                                       }
  723.     scsiUnused07                = -7929;                        {  -7929 =                                       }
  724.     scsiUnused08                = -7928;                        {  -7928 =                                       }
  725.     scsiUnableToTerminate        = -7927;                        {  -7927 = Unable to Terminate I/O PB req          }
  726.     scsiSelectTimeout            = -7926;                        {  -7926 = Target selection timeout              }
  727.     scsiCommandTimeout            = -7925;                        {  -7925 = Command timeout                       }
  728.     scsiIdentifyMessageRejected    = -7924;                        {  -7924 =                                       }
  729.     scsiMessageRejectReceived    = -7923;                        {  -7923 = Message reject received                  }
  730.     scsiSCSIBusReset            = -7922;                        {  -7922 = SCSI bus reset sent/received          }
  731.     scsiParityError                = -7921;                        {  -7921 = Uncorrectable parity error occured      }
  732.     scsiAutosenseFailed            = -7920;                        {  -7920 = Autosense: Request sense cmd fail      }
  733.     scsiUnused11                = -7919;                        {  -7919 =                                       }
  734.     scsiDataRunError            = -7918;                        {  -7918 = Data overrun/underrun error           }
  735.     scsiUnexpectedBusFree        = -7917;                        {  -7917 = Unexpected BUS free                      }
  736.     scsiSequenceFailed            = -7916;                        {  -7916 = Target bus phase sequence failure      }
  737.     scsiWrongDirection            = -7915;                        {  -7915 = Data phase was in wrong direction      }
  738.     scsiUnused16                = -7914;                        {  -7914 =                                       }
  739.     scsiBDRsent                    = -7913;                        {  -7913 = A SCSI BDR msg was sent to target      }
  740.     scsiTerminated                = -7912;                        {  -7912 = PB request terminated by the host      }
  741.     scsiNoNexus                    = -7911;                        {  -7911 = Nexus is not established              }
  742.     scsiCDBReceived                = -7910;                        {  -7910 = The SCSI CDB has been received          }
  743.                                                                 {  Couldn't begin execution  30-3F  }
  744.     scsiTooManyBuses            = -7888;                        {  -7888 = Register failed because we're full     }
  745.     scsiBusy                    = -7887;                        {  -7887 = SCSI subsystem is busy                  }
  746.     scsiProvideFail                = -7886;                        {  -7886 = Unable to provide requ. capability     }
  747.     scsiDeviceNotThere            = -7885;                        {  -7885 = SCSI device not installed/there       }
  748.     scsiNoHBA                    = -7884;                        {  -7884 = No HBA detected Error                  }
  749.     scsiDeviceConflict            = -7883;                        {  -7883 = sorry, max 1 refNum per DeviceIdent      }
  750.     scsiNoSuchXref                = -7882;                        {  -7882 = no such RefNum xref                      }
  751.     scsiQLinkInvalid            = -7881;                        {  -7881 = pre-linked PBs not supported             }
  752.                                                                 {    (The QLink field was nonzero)                 }
  753.                                                                 {  Parameter errors  40-7F  }
  754.     scsiPBLengthError            = -7872;                        {  -7872 = (scsiPBLength is insuf'ct/invalid      }
  755.     scsiFunctionNotAvailable    = -7871;                        {  -7871 = The requ. func is not available       }
  756.     scsiRequestInvalid            = -7870;                        {  -7870 = PB request is invalid                  }
  757.     scsiBusInvalid                = -7869;                        {  -7869 = Bus ID supplied is invalid               }
  758.     scsiTIDInvalid                = -7868;                        {  -7868 = Target ID supplied is invalid          }
  759.     scsiLUNInvalid                = -7867;                        {  -7867 = LUN supplied is invalid               }
  760.     scsiIDInvalid                = -7866;                        {  -7866 = The initiator ID is invalid           }
  761.     scsiDataTypeInvalid            = -7865;                        {  -7865 = scsiDataType requested not supported  }
  762.     scsiTransferTypeInvalid        = -7864;                        {  -7864 = scsiTransferType field is too high      }
  763.     scsiCDBLengthInvalid        = -7863;                        {  -7863 = scsiCDBLength field is too big          }
  764.  
  765. { New errors for SCSI Family         }
  766.     scsiUnused74                = -7862;                        {  -7862 =                                           }
  767.     scsiUnused75                = -7861;                        {  -7861 =                                          }
  768.     scsiBadDataLength            = -7860;                        {  -7860 = a zero data length in PB              }
  769.     scsiPartialPrepared            = -7859;                        {  -7859 = could not do full prepare mem for I/O }
  770.     scsiInvalidMsgType            = -7858;                        {  -7858 = Invalid message type (internal)         }
  771.     scsiUnused79                = -7857;                        {  -7857 =                                            }
  772.     scsiBadConnID                = -7856;                        {  -7856 = Bad Connection ID                       }
  773.     scsiUnused81                = -7855;                        {  -7855 =                                          }
  774.     scsiIOInProgress            = -7854;                        {  -7854 = Can't close conn, IO in prog             }
  775.     scsiTargetReserved            = -7853;                        {  -7853 = Target already reserved                 }
  776.     scsiUnused84                = -7852;                        {  -7852 =                                          }
  777.     scsiUnused85                = -7851;                        {  -7851 =                                          }
  778.     scsiBadConnType                = -7850;                        {  -7850 = Bad connection type                     }
  779.     scsiCannotLoadPlugin        = -7849;                        {  -7849 = No matching service category             }
  780.  
  781. { +++ }
  782. {
  783.  * scsiFamilyInternalError and scsiPluginInternalError are intended to handle consistency check failures.
  784.  * For example, if the family stores a record on a lookaside queue, but does not find that record
  785.  * it can use this error to report this failure. SCSI Manager 4.3 uses dsIOCoreErr in a few places,
  786.  * but this is probably not the best error. In general, internal errors should be reported as bugs.
  787.  *
  788.  * The following range of errors is provided for third-party (non-Apple) SCSI SIM and device driver vendors.
  789.  * In general, they would be used for error conditions that are not covered by the standardized errors.
  790.  * They should not normally be conveyed to normal applications, but might be used for communication between
  791.  * a plug-in and a vendor-provided device driver (for example, to manage RAID hot-swapping).
  792.  *
  793.  * Note: I don't know how many SCSI errors are reserved in the error code architecture. Don't assume that
  794.  * we'll actually get sixteen, but we should reserve at least one.
  795.  }
  796.     scsiFamilyInternalError        = -7849;                        {  -7849 = Internal consistency check failed     }
  797.     scsiPluginInternalError        = -7848;                        {  -7848 = Internal consistency check failed     }
  798.     scsiVendorSpecificErrorBase    = -7808;                        {  ??    = Start of third-party error range         }
  799.     scsiVendorSpecificErrorCount = 16;                            {  Number of third-party errors                     }
  800.  
  801. { --- }
  802.     scsiExecutionErrors            = -7936;
  803.     scsiNotExecutedErrors        = -7888;
  804.     scsiParameterErrors            = -7872;
  805.  
  806. { Defines for the scsiResultFlags field }
  807.     scsiSIMQFrozen                = $0001;                        {  The SIM queue is frozen w/this err             }
  808.     scsiAutosenseValid            = $0002;                        {  Autosense data valid for target               }
  809.     scsiBusNotFree                = $0004;                        {  At time of callback, SCSI bus is not free     }
  810.  
  811. { Defines for the bit numbers of the scsiFlags field in the PB header for the SCSIExecIO function }
  812.     kbSCSIDisableAutosense        = 29;                            {  Disable auto sense feature                      }
  813.     kbSCSIFlagReservedA            = 28;                            {                                                }
  814.     kbSCSIFlagReserved0            = 27;                            {                                                }
  815.     kbSCSICDBLinked                = 26;                            {  The PB contains a linked CDB                     }
  816.     kbSCSIQEnable                = 25;                            {  Target queue actions are enabled                 }
  817.     kbSCSICDBIsPointer            = 24;                            {  The CDB field contains a pointer                 }
  818.     kbSCSIFlagReserved1            = 23;                            {                                                   }
  819.     kbSCSIInitiateSyncData        = 22;                            {  Attempt Sync data xfer and SDTR                 }
  820.     kbSCSIDisableSyncData        = 21;                            {  Disable sync, go to async                     }
  821.     kbSCSISIMQHead                = 20;                            {  Place PB at the head of SIM Q                 }
  822.     kbSCSISIMQFreeze            = 19;                            {  Return the SIM Q to frozen state                 }
  823.     kbSCSISIMQNoFreeze            = 18;                            {  Disallow SIM Q freezing                         }
  824.     kbSCSIDoDisconnect            = 17;                            {  Definitely do disconnect                         }
  825.     kbSCSIDontDisconnect        = 16;                            {  Definitely don't disconnect                     }
  826.     kbSCSIDataReadyForDMA        = 15;                            {  Data buffer(s) are ready for DMA                 }
  827.     kbSCSIFlagReserved3            = 14;                            {                                                   }
  828.     kbSCSIDataPhysical            = 13;                            {  SG/Buffer data ptrs are physical                 }
  829.     kbSCSISensePhysical            = 12;                            {  Autosense buffer ptr is physical                 }
  830.     kbSCSIFlagReserved5            = 11;                            {                                                   }
  831.     kbSCSIFlagReserved6            = 10;                            {                                                   }
  832.     kbSCSIFlagReserved7            = 9;                            {                                                   }
  833.     kbSCSIFlagReserved8            = 8;                            {                                                   }
  834.     kbSCSIDataBufferValid        = 7;                            {  Data buffer valid                             }
  835.     kbSCSIStatusBufferValid        = 6;                            {  Status buffer valid                              }
  836.     kbSCSIMessageBufferValid    = 5;                            {  Message buffer valid                             }
  837.     kbSCSIFlagReserved9            = 4;                            {                                                }
  838.  
  839. { Defines for the bit masks of the scsiFlags field }
  840.     scsiDirectionMask            = $C0000000;                    {  Data direction mask                         }
  841.     scsiDirectionNone            = $C0000000;                    {  Data direction (11: no data)                 }
  842.     scsiDirectionReserved        = $00000000;                    {  Data direction (00: reserved)             }
  843.     scsiDirectionOut            = $80000000;                    {  Data direction (10: DATA OUT)             }
  844.     scsiDirectionIn                = $40000000;                    {  Data direction (01: DATA IN)                 }
  845.     scsiDisableAutosense        = $20000000;                    {  Disable auto sense feature                 }
  846.     scsiFlagReservedA            = $10000000;                    {                                               }
  847.     scsiFlagReserved0            = $08000000;                    {                                               }
  848.     scsiCDBLinked                = $04000000;                    {  The PB contains a linked CDB                 }
  849.     scsiQEnable                    = $02000000;                    {  Target queue actions are enabled             }
  850.     scsiCDBIsPointer            = $01000000;                    {  The CDB field contains a pointer             }
  851.     scsiFlagReserved1            = $00800000;                    {                                               }
  852.     scsiInitiateSyncData        = $00400000;                    {  Attempt Sync data xfer and SDTR             }
  853.     scsiDisableSyncData            = $00200000;                    {  Disable sync, go to async                 }
  854.     scsiSIMQHead                = $00100000;                    {  Place PB at the head of SIM Q             }
  855.     scsiSIMQFreeze                = $00080000;                    {  Return the SIM Q to frozen state             }
  856.     scsiSIMQNoFreeze            = $00040000;                    {  Disallow SIM Q freezing                     }
  857.     scsiDoDisconnect            = $00020000;                    {  Definitely do disconnect                     }
  858.     scsiDontDisconnect            = $00010000;                    {  Definitely don't disconnect                 }
  859.     scsiDataReadyForDMA            = $00008000;                    {  Data buffer(s) are ready for DMA             }
  860.     scsiFlagReserved3            = $00004000;                    {    }
  861.     scsiDataPhysical            = $00002000;                    {  SG/Buffer data ptrs are physical             }
  862.     scsiSensePhysical            = $00001000;                    {  Autosense buffer ptr is physical             }
  863.     scsiFlagReserved5            = $00000800;                    {                                            }
  864.     scsiFlagReserved6            = $00000400;                    {                                               }
  865.     scsiFlagReserved7            = $00000200;                    {                                               }
  866.     scsiFlagReserved8            = $00000100;                    {                                               }
  867.  
  868. { bit masks for the scsiIOFlags field in SCSIExecIOPB }
  869.     scsiNoParityCheck            = $0002;                        {  disable parity checking                              }
  870.     scsiDisableSelectWAtn        = $0004;                        {  disable select w/Atn                               }
  871.     scsiSavePtrOnDisconnect        = $0008;                        {  do SaveDataPointer upon Disconnect msg              }
  872.     scsiNoBucketIn                = $0010;                        {  don’t bit bucket in during this I/O                  }
  873.     scsiNoBucketOut                = $0020;                        {  don’t bit bucket out during this I/O              }
  874.     scsiDisableWide                = $0040;                        {  disable wide transfer negotiation                  }
  875.     scsiInitiateWide            = $0080;                        {  initiate wide transfer negotiation                  }
  876.     scsiRenegotiateSense        = $0100;                        {  renegotiate sync/wide before issuing autosense      }
  877.     scsiDisableDiscipline        = $0200;                        {  disable parameter checking on SCSIExecIO calls     }
  878.     scsiIOFlagReserved0080        = $0080;                        {                                                    }
  879.     scsiIOFlagReserved8000        = $8000;                        {                                                       }
  880.  
  881. { Defines for the Bus Inquiry PB fields. }
  882. { scsiHBAInquiry field bits }
  883.     scsiBusMDP                    = $80;                            {  Supports Modify Data Pointer message                         }
  884.     scsiBusWide32                = $40;                            {  Supports 32 bit wide SCSI                                 }
  885.     scsiBusWide16                = $20;                            {  Supports 16 bit wide SCSI                                 }
  886.     scsiBusSDTR                    = $10;                            {  Supports Sync Data Transfer Req message                     }
  887.     scsiBusLinkedCDB            = $08;                            {  Supports linked CDBs                                         }
  888.     scsiBusTagQ                    = $02;                            {  Supports tag queue message                                 }
  889.     scsiBusSoftReset            = $01;                            {  Supports soft reset                                         }
  890.  
  891. { Defines for the scsiDataType field }
  892.     scsiDataBuffer                = 0;                            {  single contiguous buffer supplied                   }
  893.     scsiDataTIB                    = 1;                            {  TIB supplied (ptr in scsiDataPtr)                  }
  894.     scsiDataSG                    = 2;                            {  scatter/gather list supplied                       }
  895.     scsiDataIOTable                = 3;                            { #(7/11/95) Prepared by Block Storage               }
  896.  
  897. { scsiDataTypes field bits  }
  898. {    bits 0->15 Apple-defined, 16->30 3rd-party unique, 31 = reserved }
  899.     scsiBusDataTIB                = $02;                            {  TIB supplied (ptr in scsiDataPtr)         }
  900.     scsiBusDataBuffer            = $01;                            {  single contiguous buffer supplied          }
  901.     scsiBusDataSG                = $04;                            {  scatter/gather list supplied              }
  902.     scsiBusDataIOTable            = $08;                            {  (2/6/95) Prepare Memory for IO }
  903.     scsiBusDataReserved            = $80000000;                    {                                             }
  904.  
  905. { scsiScanFlags field bits }
  906.     scsiBusScansDevices            = $80;                            {  Bus scans for and maintains device list             }
  907.     scsiBusScansOnInit            = $40;                            {  Bus scans performed at power-up/reboot             }
  908.     scsiBusLoadsROMDrivers        = $20;                            {  may load ROM drivers to support targets              }
  909.  
  910. { scsiFeatureFlags field bits }
  911.     scsiBusInternalExternalMask    = $000000C0;                    {  bus internal/external mask                     }
  912.     scsiBusInternalExternalUnknown = $00000000;                    {  not known whether bus is inside or outside      }
  913.     scsiBusInternalExternal        = $000000C0;                    {  bus goes inside and outside the box              }
  914.     scsiBusInternal                = $00000080;                    {  bus goes inside the box                          }
  915.     scsiBusExternal                = $00000040;                    {  bus goes outside the box                      }
  916.     scsiBusCacheCoherentDMA        = $00000020;                    {  DMA is cache coherent                          }
  917.     scsiBusOldCallCapable        = $00000010;                    {  SIM is old call capable                          }
  918.     scsiBusDifferential            = $00000004;                    {  Single Ended (0) or Differential (1)          }
  919.     scsiBusFastSCSI                = $00000002;                    {  HBA supports fast SCSI                          }
  920.     scsiBusDMAavailable            = $00000001;                    {  DMA is available                              }
  921.  
  922. { scsiWeirdStuff field bits }
  923.     scsiOddDisconnectUnsafeRead1 = $0001;                        {  Disconnects on odd byte boundries are unsafe with DMA and/or blind reads  }
  924.     scsiOddDisconnectUnsafeWrite1 = $0002;                        {  Disconnects on odd byte boundries are unsafe with DMA and/or blind writes  }
  925.     scsiBusErrorsUnsafe            = $0004;                        {  Non-handshaked delays or disconnects during blind transfers may cause a crash  }
  926.     scsiRequiresHandshake        = $0008;                        {  Non-handshaked delays or disconnects during blind transfers may cause data corruption  }
  927.     scsiTargetDrivenSDTRSafe    = $0010;                        {  Targets which initiate synchronous negotiations are supported  }
  928.     scsiOddCountForPhysicalUnsafe = $0020;                        {  If using physical addrs all counts must be even, and disconnects must be on even boundries  }
  929.     scsiAbortCmdFixed            = $0040;                        {  Set if abort command is fixed to properly make callbacks  }
  930.     scsiMeshACKTimingFixed        = $0080;                        {  Set if bug allowing Mesh to release ACK prematurely is fixed  }
  931.  
  932. { scsiHBAslotType values }
  933.     scsiMotherboardBus            = $00;                            {  A built in Apple supplied bus                      }
  934.     scsiNuBus                    = $01;                            {  A SIM on a NuBus card                              }
  935.     scsiPDSBus                    = $03;                            {     "  on a PDS card                                 }
  936.     scsiPCIBus                    = $04;                            {     "  on a PCI bus card                             }
  937.     scsiPCMCIABus                = $05;                            {     "  on a PCMCIA card                             }
  938.     scsiFireWireBridgeBus        = $06;                            {     "  connected through a FireWire bridge         }
  939.  
  940. { Defines for the scsiDriverFlags field (in SCSIDriverPB) }
  941.     scsiDeviceSensitive            = $0001;                        {  Only driver should access this device                 }
  942.     scsiDeviceNoOldCallAccess    = $0002;                        {  no old call access to this device                      }
  943.  
  944. {  SIMInitInfo PB }
  945. { directions are for SCSIRegisterBus call ( -> parm, <- result)             }
  946.  
  947. TYPE
  948.     SIMInitInfoPtr = ^SIMInitInfo;
  949.     SIMInitInfo = RECORD
  950.         SIMstaticPtr:            Ptr;                                    {  <- alloc. ptr to the SIM's static vars                  }
  951.         staticSize:                LONGINT;                                {  -> num bytes SIM needs for static vars                  }
  952.         SIMInit:                SIMInitUPP;                                {  -> pointer to the SIM init routine                      }
  953.         SIMAction:                SIMActionUPP;                            {  -> pointer to the SIM action routine                  }
  954.         SIM_ISR:                SCSIInterruptUPP;                        {        reserved                                              }
  955.         SIMInterruptPoll:        SCSIInterruptUPP;                        {  -> pointer to the SIM interrupt poll routine             }
  956.         NewOldCall:                SIMActionUPP;                            {  -> pointer to the SIM NewOldCall routine                 }
  957.         ioPBSize:                UInt16;                                    {  -> size of SCSI_IO_PBs required for this SIM             }
  958.         oldCallCapable:            BOOLEAN;                                {  -> true if this SIM can handle old-API calls             }
  959.         simInfoUnused1:            SInt8;                                    {        reserved                                             }
  960.         simInternalUse:            LONGINT;                                {  xx not affected or viewed by XPT                         }
  961.         XPT_ISR:                SCSIUPP;                                {     reserved                                             }
  962.         EnteringSIM:            SCSIUPP;                                {  <- ptr to the EnteringSIM routine                     }
  963.         ExitingSIM:                SCSIUPP;                                {  <- ptr to the ExitingSIM routine                         }
  964.         MakeCallback:            SCSIMakeCallbackUPP;                    {  <- the XPT layer’s SCSIMakeCallback routine             }
  965.         busID:                    UInt16;                                    {  <- bus number for the registered bus                     }
  966.         simSlotNumber:            SInt8;                                    {  <- Magic cookie to place in scsiHBASlotNumber (PCI)     }
  967.         simSRsrcID:                SInt8;                                    {  <- Magic cookie to place in scsiSIMsRsrcID     (PCI)     }
  968.         simRegEntry:            Ptr;                                    {  -> The SIM's RegEntryIDPtr                     (PCI)     }
  969.     END;
  970.  
  971. { Glue between SCSI calls and SCSITrap format }
  972.  
  973. CONST
  974.     xptSCSIAction                = $0001;
  975.     xptSCSIRegisterBus            = $0002;
  976.     xptSCSIDeregisterBus        = $0003;
  977.     xptSCSIReregisterBus        = $0004;
  978.     xptSCSIKillXPT                = $0005;                        {  kills Mini-XPT after transition  }
  979.     xptSCSIInitialize            = $000A;                        {  Initialize the SCSI manager  }
  980.  
  981. {
  982.  * SCSI bus status. These values are returned by the SCSI target in the status phase.
  983.  * They are not related to Macintosh status values (except that values other than
  984.  * scsiStatusGood will result in scsiResult set to scsiNonZeroStatus).
  985.  }
  986.     scsiStatGood                = $00;                            {  Good Status }
  987.     scsiStatCheckCondition        = $02;                            {  Check Condition }
  988.     scsiStatConditionMet        = $04;                            {  Condition Met }
  989.     scsiStatBusy                = $08;                            {  Busy }
  990.     scsiStatIntermediate        = $10;                            {  Intermediate }
  991.     scsiStatIntermedMet            = $14;                            {  Intermediate - Condition Met }
  992.     scsiStatResvConflict        = $18;                            {  Reservation conflict }
  993.     scsiStatTerminated            = $22;                            {  Command terminated }
  994.     scsiStatQFull                = $28;                            {  Queue full }
  995.  
  996. {  SCSI messages }
  997.     kCmdCompleteMsg                = 0;
  998.     kExtendedMsg                = 1;                            {  0x01 }
  999.     kSaveDataPointerMsg            = 2;                            {  0x02 }
  1000.     kRestorePointersMsg            = 3;                            {  0x03 }
  1001.     kDisconnectMsg                = 4;                            {  0x04 }
  1002.     kInitiatorDetectedErrorMsg    = 5;                            {  0x05 }
  1003.     kAbortMsg                    = 6;                            {  0x06 }
  1004.     kMsgRejectMsg                = 7;                            {  0x07 }
  1005.     kNoOperationMsg                = 8;                            {  0x08 }
  1006.     kMsgParityErrorMsg            = 9;                            {  0x09 }
  1007.     kLinkedCmdCompleteMsg        = 10;                            {  0x0a }
  1008.     kLinkedCmdCompleteWithFlagMsg = 11;                            {  0x0b }
  1009.     kBusDeviceResetMsg            = 12;                            {  0x0c }
  1010.     kAbortTagMsg                = 13;                            {  0x0d }
  1011.     kClearQueueMsg                = 14;                            {  0x0e }
  1012.     kInitiateRecoveryMsg        = 15;                            {  0x0f }
  1013.     kReleaseRecoveryMsg            = 16;                            {  0x10 }
  1014.     kTerminateIOProcessMsg        = 17;                            {  0x11 }
  1015.     kSimpleQueueTag                = $20;                            {  0x20 }
  1016.     kHeadOfQueueTagMsg            = $21;                            {  0x21 }
  1017.     kOrderedQueueTagMsg            = $22;                            {  0x22 }
  1018.     kIgnoreWideResidueMsg        = $23;                            {  0x23 }
  1019.  
  1020.  
  1021. { moveq #kSCSIx, D0;  _SCSIAtomic }
  1022. FUNCTION SCSIAction(VAR parameterBlock: SCSI_PB): OSErr;
  1023.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1024.     INLINE $205F, $7001, $A089, $3E80;
  1025.     {$ENDC}
  1026. FUNCTION SCSIRegisterBus(VAR parameterBlock: SIMInitInfo): OSErr;
  1027.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1028.     INLINE $205F, $7002, $A089, $3E80;
  1029.     {$ENDC}
  1030. FUNCTION SCSIDeregisterBus(VAR parameterBlock: SCSI_PB): OSErr;
  1031.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1032.     INLINE $205F, $7003, $A089, $3E80;
  1033.     {$ENDC}
  1034. FUNCTION SCSIReregisterBus(VAR parameterBlock: SIMInitInfo): OSErr;
  1035.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1036.     INLINE $205F, $7004, $A089, $3E80;
  1037.     {$ENDC}
  1038. FUNCTION SCSIKillXPT(VAR parameterBlock: SIMInitInfo): OSErr;
  1039.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  1040.     INLINE $205F, $7005, $A089, $3E80;
  1041.     {$ENDC}
  1042.  
  1043. {$ALIGN RESET}
  1044. {$POP}
  1045.  
  1046. {$SETC UsingIncludes := SCSIIncludes}
  1047.  
  1048. {$ENDC} {__SCSI__}
  1049.  
  1050. {$IFC NOT UsingIncludes}
  1051.  END.
  1052. {$ENDC}
  1053.